package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Window.Type;
import net.miginfocom.swing.MigLayout;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JSeparator;
import javax.swing.JButton;
import javax.swing.JPasswordField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LogInGui extends JFrame {

	private JPanel contentPane;
	private JTextField loginField;
	private JPasswordField passwordField;


	/**
	 * Create the frame.
	 */
	public LogInGui() {
		setTitle("Login");
		setAlwaysOnTop(true);
		setResizable(false);
		setType(Type.UTILITY);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 264, 161);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new MigLayout("", "[][][grow][]", "[][][][][]"));
		
		JLabel lblLoginMenu = new JLabel("Login");
		contentPane.add(lblLoginMenu, "cell 1 0 2 1,alignx center");
		
		JSeparator separator = new JSeparator();
		contentPane.add(separator, "cell 0 1 4 1,growx");
		
		JLabel lblName = new JLabel("Username:");
		contentPane.add(lblName, "cell 1 2,alignx right");
		
		loginField = new JTextField();
		contentPane.add(loginField, "cell 2 2,growx");
		loginField.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("Password:");
		contentPane.add(lblNewLabel, "cell 1 3,alignx trailing");
		
		passwordField = new JPasswordField();
		contentPane.add(passwordField, "cell 2 3,growx");
		
		JButton btnLogin = new JButton("Login");
		contentPane.add(btnLogin, "cell 1 4");
		
		JButton btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();
			}
		});
		contentPane.add(btnCancel, "cell 2 4");
	}

}
